﻿<%@ Page Language="vb" ContentType="text/xml" AutoEventWireup="false" CodeBehind="RSS.aspx.vb" Inherits="Assignment_2___Prototype.RSS" %>
<%@ Import Namespace="System.Data" %>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    SelectCommand="SELECT [ParrotID], [Species], [Breed], [ParrotSize], [LifeSpan], [NoiseLevel], [TalkingAbility] FROM [Parrot]">
</asp:SqlDataSource>

<asp:Repeater id="rptRSS" runat="server" DataSourceID="SqlDataSource1">
  <HeaderTemplate>
    <rss version="2.0">
      <channel>
        <title>Parrot List </title>
        <description>Parrots from all over the world</description>
  </HeaderTemplate>
  <ItemTemplate>
        <item>
          <title><%# FormatForXML(DataBinder.Eval(Container.DataItem, "Species"))%></title>
          <description><%# FormatForXML(DataBinder.Eval(Container.DataItem, "Breed"))%></description>
          <link> Details.aspx?D=<%# FormatForXML(DataBinder.Eval(Container.DataItem, "ParrotID"))%></link>
          <author><%# FormatForXML(DataBinder.Eval(Container.DataItem, "ParrotSize"))%></author>
          <pubDate><%# FormatForXML(DataBinder.Eval(Container.DataItem, "LifeSpan"))%></pubDate>
        </item>
  </ItemTemplate>
  <FooterTemplate>
      </channel>
    </rss>  
  </FooterTemplate>
</asp:Repeater>

